package com.hyb.service.impl;
import com.hyb.mapper.UserMapper;
import com.hyb.pojo.User;
import com.hyb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> getAll(Map maps) {
        return userMapper.selectAll(maps);
    }

    @Override
    public User getById(int id) {
        return userMapper.selectById(id);
    }

    @Override
    public User getByName(String username) {
        return userMapper.selectByName(username);
    }

    @Override
    public void deleteById(int id) {
        userMapper.deleteById(id);
    }

    @Override
    public int count() {
        return userMapper.count();
    }

    @Override
    public void addUser(Map user) {
        userMapper.addUser(user);
    }

    @Override
    public void updataUser(User user) {
        userMapper.updataUser(user);
    }

    @Override
    public List<User> getAllExcludeById(int id) {
        return userMapper.selectAllExcludeById(id);
    }

}
